<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Jetson Inference: jetson-utils/RingBuffer.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="NVLogo_2D.jpg"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Jetson Inference
   </div>
   <div id="projectbrief">DNN Vision Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('RingBuffer_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">RingBuffer.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="RingBuffer_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> * copy of this software and associated documentation files (the &quot;Software&quot;),</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> * to deal in the Software without restriction, including without limitation</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> * the rights to use, copy, modify, merge, publish, distribute, sublicense,</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> * and/or sell copies of the Software, and to permit persons to whom the</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> * Software is furnished to do so, subject to the following conditions:</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> * The above copyright notice and this permission notice shall be included in</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> * all copies or substantial portions of the Software.</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"> * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment"> * DEALINGS IN THE SOFTWARE.</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160; </div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="preprocessor">#ifndef __MULTITHREAD_RINGBUFFER_H_</span></div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="preprocessor">#define __MULTITHREAD_RINGBUFFER_H_</span></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160; </div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="Mutex_8h.html">Mutex.h</a>&quot;</span></div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160; </div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160; </div>
<div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="group__threads.html">   33</a></span>&#160;<span class="keyword">class </span><a class="code" href="group__threads.html#classRingBuffer">RingBuffer</a></div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;{</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="group__threads.html#add028ff4436a9c7467ea5df2d81623a4">   39</a></span>&#160;        <span class="keyword">enum</span> <a class="code" href="group__threads.html#add028ff4436a9c7467ea5df2d81623a4">Flags</a></div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;        {</div>
<div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="group__threads.html#add028ff4436a9c7467ea5df2d81623a4ae7368f8f66751388d6eca8acab34e8b2">   41</a></span>&#160;                <a class="code" href="group__threads.html#add028ff4436a9c7467ea5df2d81623a4ae7368f8f66751388d6eca8acab34e8b2">Read</a>           = (1 &lt;&lt; 0),                              </div>
<div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="group__threads.html#add028ff4436a9c7467ea5df2d81623a4a5d7fba78a3b416422add48911552b788">   42</a></span>&#160;                <a class="code" href="group__threads.html#add028ff4436a9c7467ea5df2d81623a4a5d7fba78a3b416422add48911552b788">ReadOnce</a>       = (1 &lt;&lt; 1) | <a class="code" href="group__threads.html#add028ff4436a9c7467ea5df2d81623a4ae7368f8f66751388d6eca8acab34e8b2">Read</a>,                       </div>
<div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="group__threads.html#add028ff4436a9c7467ea5df2d81623a4a618d08b68f28a0deebc922c4fd29b150">   43</a></span>&#160;                <a class="code" href="group__threads.html#add028ff4436a9c7467ea5df2d81623a4a618d08b68f28a0deebc922c4fd29b150">ReadLatest</a>     = (1 &lt;&lt; 2) | <a class="code" href="group__threads.html#add028ff4436a9c7467ea5df2d81623a4ae7368f8f66751388d6eca8acab34e8b2">Read</a>,                       </div>
<div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="group__threads.html#add028ff4436a9c7467ea5df2d81623a4a016f5aaf642491df7dd14d2728b38973">   44</a></span>&#160;                <a class="code" href="group__threads.html#add028ff4436a9c7467ea5df2d81623a4a016f5aaf642491df7dd14d2728b38973">ReadLatestOnce</a> = (1 &lt;&lt; 3) | <a class="code" href="group__threads.html#add028ff4436a9c7467ea5df2d81623a4a618d08b68f28a0deebc922c4fd29b150">ReadLatest</a>,         </div>
<div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="group__threads.html#add028ff4436a9c7467ea5df2d81623a4aa40fc1352f6c1c44e21d12a856cd9e35">   45</a></span>&#160;                <a class="code" href="group__threads.html#add028ff4436a9c7467ea5df2d81623a4aa40fc1352f6c1c44e21d12a856cd9e35">Write</a>          = (1 &lt;&lt; 4),                              </div>
<div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="group__threads.html#add028ff4436a9c7467ea5df2d81623a4a1118d6f9d4da6a8b6fbc5d6de4c093e9">   46</a></span>&#160;                <a class="code" href="group__threads.html#add028ff4436a9c7467ea5df2d81623a4a1118d6f9d4da6a8b6fbc5d6de4c093e9">Threaded</a>       = (1 &lt;&lt; 5),                              </div>
<div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="group__threads.html#add028ff4436a9c7467ea5df2d81623a4a5a1ff357668813e74eb7656cc035f91e">   47</a></span>&#160;                <a class="code" href="group__threads.html#add028ff4436a9c7467ea5df2d81623a4a5a1ff357668813e74eb7656cc035f91e">ZeroCopy</a>       = (1 &lt;&lt; 6),                              </div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;        };</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;        </div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;        <span class="keyword">inline</span> <a class="code" href="group__threads.html#ae18d0a5ac60eb4db2f99887772ed5778">RingBuffer</a>( uint32_t flags=<a class="code" href="group__threads.html#add028ff4436a9c7467ea5df2d81623a4a1118d6f9d4da6a8b6fbc5d6de4c093e9">Threaded</a> );</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160; </div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;        <span class="keyword">inline</span> <a class="code" href="group__threads.html#a2715b2e99ea24521ef7a586c2f33e1c9">~RingBuffer</a>();</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160; </div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;        <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="group__threads.html#a41718c1a3577dee2d0f7cfea02667535">Alloc</a>( uint32_t numBuffers, <span class="keywordtype">size_t</span> size, uint32_t flags=0 );</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160; </div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;        <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__threads.html#a787fdb833c95a386e6ec3e19fb6d1fd8">Free</a>();</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160; </div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;        <span class="keyword">inline</span> <span class="keywordtype">void</span>* <a class="code" href="group__threads.html#a65cd66112df93d973d7425295c382055">Peek</a>( uint32_t flags );</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160; </div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;        <span class="keyword">inline</span> <span class="keywordtype">void</span>* <a class="code" href="group__threads.html#adc642b75c7ebe3aa48da4ece8f13643b">Next</a>( uint32_t flags );</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160; </div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;        <span class="keyword">inline</span> uint32_t <a class="code" href="group__threads.html#a13c5161ed54ede296a4c5f079fbaface">GetFlags</a>() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;        </div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;        <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__threads.html#ab9066deaa7cee206d7f604a443766955">SetFlags</a>( uint32_t flags );</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;        </div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;        <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__threads.html#a1a39008053c6aa06e348fa5b2ead2f91">SetThreaded</a>( <span class="keywordtype">bool</span> threaded );</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160; </div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;<span class="keyword">protected</span>:</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160; </div>
<div class="line"><a name="l00104"></a><span class="lineno"><a class="line" href="group__threads.html#a884afb997bffaf51d550e88d97e062d2">  104</a></span>&#160;        uint32_t <a class="code" href="group__threads.html#a884afb997bffaf51d550e88d97e062d2">mNumBuffers</a>;</div>
<div class="line"><a name="l00105"></a><span class="lineno"><a class="line" href="group__threads.html#ab2322c263d4e1e928848ff4c33893713">  105</a></span>&#160;        uint32_t <a class="code" href="group__threads.html#ab2322c263d4e1e928848ff4c33893713">mLatestRead</a>;</div>
<div class="line"><a name="l00106"></a><span class="lineno"><a class="line" href="group__threads.html#a767436a25c53cfb845f731e0ff633120">  106</a></span>&#160;        uint32_t <a class="code" href="group__threads.html#a767436a25c53cfb845f731e0ff633120">mLatestWrite</a>;</div>
<div class="line"><a name="l00107"></a><span class="lineno"><a class="line" href="group__threads.html#aa3177dcbe1bf1a936e810a709361df94">  107</a></span>&#160;        uint32_t <a class="code" href="group__threads.html#aa3177dcbe1bf1a936e810a709361df94">mFlags</a>;</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160; </div>
<div class="line"><a name="l00109"></a><span class="lineno"><a class="line" href="group__threads.html#a1828b9679d7da6caaa486b2bca487d42">  109</a></span>&#160;        <span class="keywordtype">void</span>** <a class="code" href="group__threads.html#a1828b9679d7da6caaa486b2bca487d42">mBuffers</a>;</div>
<div class="line"><a name="l00110"></a><span class="lineno"><a class="line" href="group__threads.html#a5025680071ca78b1e204d4931d2a70cd">  110</a></span>&#160;        <span class="keywordtype">size_t</span> <a class="code" href="group__threads.html#a5025680071ca78b1e204d4931d2a70cd">mBufferSize</a>;</div>
<div class="line"><a name="l00111"></a><span class="lineno"><a class="line" href="group__threads.html#a52c369f6697dea2696e0b4b9be08b622">  111</a></span>&#160;        <span class="keywordtype">bool</span>   <a class="code" href="group__threads.html#a52c369f6697dea2696e0b4b9be08b622">mReadOnce</a>;</div>
<div class="line"><a name="l00112"></a><span class="lineno"><a class="line" href="group__threads.html#ad8fadecc95016c471104fbadb1b0e9f3">  112</a></span>&#160;        <a class="code" href="group__threads.html#classMutex">Mutex</a>  <a class="code" href="group__threads.html#ad8fadecc95016c471104fbadb1b0e9f3">mMutex</a>;</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;};</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160; </div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;<span class="comment">// inline implementations</span></div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;<span class="preprocessor">#include &quot;RingBuffer.inl&quot;</span></div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160; </div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160; </div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<div class="ttc" id="agroup__threads_html_a2715b2e99ea24521ef7a586c2f33e1c9"><div class="ttname"><a href="group__threads.html#a2715b2e99ea24521ef7a586c2f33e1c9">RingBuffer::~RingBuffer</a></div><div class="ttdeci">~RingBuffer()</div><div class="ttdoc">Destructor.</div></div>
<div class="ttc" id="agroup__threads_html_a52c369f6697dea2696e0b4b9be08b622"><div class="ttname"><a href="group__threads.html#a52c369f6697dea2696e0b4b9be08b622">RingBuffer::mReadOnce</a></div><div class="ttdeci">bool mReadOnce</div><div class="ttdef"><b>Definition:</b> RingBuffer.h:111</div></div>
<div class="ttc" id="agroup__threads_html_add028ff4436a9c7467ea5df2d81623a4a1118d6f9d4da6a8b6fbc5d6de4c093e9"><div class="ttname"><a href="group__threads.html#add028ff4436a9c7467ea5df2d81623a4a1118d6f9d4da6a8b6fbc5d6de4c093e9">RingBuffer::Threaded</a></div><div class="ttdeci">@ Threaded</div><div class="ttdoc">Buffers should be thread-safe (enabled by default).</div><div class="ttdef"><b>Definition:</b> RingBuffer.h:46</div></div>
<div class="ttc" id="agroup__threads_html_a884afb997bffaf51d550e88d97e062d2"><div class="ttname"><a href="group__threads.html#a884afb997bffaf51d550e88d97e062d2">RingBuffer::mNumBuffers</a></div><div class="ttdeci">uint32_t mNumBuffers</div><div class="ttdef"><b>Definition:</b> RingBuffer.h:104</div></div>
<div class="ttc" id="agroup__threads_html_ae18d0a5ac60eb4db2f99887772ed5778"><div class="ttname"><a href="group__threads.html#ae18d0a5ac60eb4db2f99887772ed5778">RingBuffer::RingBuffer</a></div><div class="ttdeci">RingBuffer(uint32_t flags=Threaded)</div><div class="ttdoc">Construct a new ring buffer.</div></div>
<div class="ttc" id="agroup__threads_html_add028ff4436a9c7467ea5df2d81623a4a5d7fba78a3b416422add48911552b788"><div class="ttname"><a href="group__threads.html#add028ff4436a9c7467ea5df2d81623a4a5d7fba78a3b416422add48911552b788">RingBuffer::ReadOnce</a></div><div class="ttdeci">@ ReadOnce</div><div class="ttdoc">Read the next buffer, but only if it hasn't been read before.</div><div class="ttdef"><b>Definition:</b> RingBuffer.h:42</div></div>
<div class="ttc" id="agroup__threads_html_a5025680071ca78b1e204d4931d2a70cd"><div class="ttname"><a href="group__threads.html#a5025680071ca78b1e204d4931d2a70cd">RingBuffer::mBufferSize</a></div><div class="ttdeci">size_t mBufferSize</div><div class="ttdef"><b>Definition:</b> RingBuffer.h:110</div></div>
<div class="ttc" id="agroup__threads_html_adc642b75c7ebe3aa48da4ece8f13643b"><div class="ttname"><a href="group__threads.html#adc642b75c7ebe3aa48da4ece8f13643b">RingBuffer::Next</a></div><div class="ttdeci">void * Next(uint32_t flags)</div><div class="ttdoc">Get the next read/write buffer and advance the position in the queue.</div></div>
<div class="ttc" id="agroup__threads_html_classMutex"><div class="ttname"><a href="group__threads.html#classMutex">Mutex</a></div><div class="ttdoc">A lightweight mutual exclusion lock.</div><div class="ttdef"><b>Definition:</b> Mutex.h:35</div></div>
<div class="ttc" id="agroup__threads_html_a1828b9679d7da6caaa486b2bca487d42"><div class="ttname"><a href="group__threads.html#a1828b9679d7da6caaa486b2bca487d42">RingBuffer::mBuffers</a></div><div class="ttdeci">void ** mBuffers</div><div class="ttdef"><b>Definition:</b> RingBuffer.h:109</div></div>
<div class="ttc" id="agroup__threads_html_a13c5161ed54ede296a4c5f079fbaface"><div class="ttname"><a href="group__threads.html#a13c5161ed54ede296a4c5f079fbaface">RingBuffer::GetFlags</a></div><div class="ttdeci">uint32_t GetFlags() const</div><div class="ttdoc">Get the flags of the ring buffer.</div></div>
<div class="ttc" id="agroup__threads_html_add028ff4436a9c7467ea5df2d81623a4a618d08b68f28a0deebc922c4fd29b150"><div class="ttname"><a href="group__threads.html#add028ff4436a9c7467ea5df2d81623a4a618d08b68f28a0deebc922c4fd29b150">RingBuffer::ReadLatest</a></div><div class="ttdeci">@ ReadLatest</div><div class="ttdoc">Read the latest buffer in the queue, skipping other buffers that may not have been read.</div><div class="ttdef"><b>Definition:</b> RingBuffer.h:43</div></div>
<div class="ttc" id="agroup__threads_html_ab9066deaa7cee206d7f604a443766955"><div class="ttname"><a href="group__threads.html#ab9066deaa7cee206d7f604a443766955">RingBuffer::SetFlags</a></div><div class="ttdeci">void SetFlags(uint32_t flags)</div><div class="ttdoc">Set the ring buffer's flags.</div></div>
<div class="ttc" id="agroup__threads_html_add028ff4436a9c7467ea5df2d81623a4aa40fc1352f6c1c44e21d12a856cd9e35"><div class="ttname"><a href="group__threads.html#add028ff4436a9c7467ea5df2d81623a4aa40fc1352f6c1c44e21d12a856cd9e35">RingBuffer::Write</a></div><div class="ttdeci">@ Write</div><div class="ttdoc">Write the next buffer.</div><div class="ttdef"><b>Definition:</b> RingBuffer.h:45</div></div>
<div class="ttc" id="agroup__threads_html_a41718c1a3577dee2d0f7cfea02667535"><div class="ttname"><a href="group__threads.html#a41718c1a3577dee2d0f7cfea02667535">RingBuffer::Alloc</a></div><div class="ttdeci">bool Alloc(uint32_t numBuffers, size_t size, uint32_t flags=0)</div><div class="ttdoc">Allocate memory for a set of buffers, where each buffer has the specified size.</div></div>
<div class="ttc" id="agroup__threads_html_ad8fadecc95016c471104fbadb1b0e9f3"><div class="ttname"><a href="group__threads.html#ad8fadecc95016c471104fbadb1b0e9f3">RingBuffer::mMutex</a></div><div class="ttdeci">Mutex mMutex</div><div class="ttdef"><b>Definition:</b> RingBuffer.h:112</div></div>
<div class="ttc" id="agroup__threads_html_add028ff4436a9c7467ea5df2d81623a4"><div class="ttname"><a href="group__threads.html#add028ff4436a9c7467ea5df2d81623a4">RingBuffer::Flags</a></div><div class="ttdeci">Flags</div><div class="ttdoc">Ring buffer flags.</div><div class="ttdef"><b>Definition:</b> RingBuffer.h:39</div></div>
<div class="ttc" id="agroup__threads_html_a1a39008053c6aa06e348fa5b2ead2f91"><div class="ttname"><a href="group__threads.html#a1a39008053c6aa06e348fa5b2ead2f91">RingBuffer::SetThreaded</a></div><div class="ttdeci">void SetThreaded(bool threaded)</div><div class="ttdoc">Enable or disable multi-threading.</div></div>
<div class="ttc" id="agroup__threads_html_a787fdb833c95a386e6ec3e19fb6d1fd8"><div class="ttname"><a href="group__threads.html#a787fdb833c95a386e6ec3e19fb6d1fd8">RingBuffer::Free</a></div><div class="ttdeci">void Free()</div><div class="ttdoc">Free the buffer allocations.</div></div>
<div class="ttc" id="agroup__threads_html_add028ff4436a9c7467ea5df2d81623a4ae7368f8f66751388d6eca8acab34e8b2"><div class="ttname"><a href="group__threads.html#add028ff4436a9c7467ea5df2d81623a4ae7368f8f66751388d6eca8acab34e8b2">RingBuffer::Read</a></div><div class="ttdeci">@ Read</div><div class="ttdoc">Read the next buffer.</div><div class="ttdef"><b>Definition:</b> RingBuffer.h:41</div></div>
<div class="ttc" id="aMutex_8h_html"><div class="ttname"><a href="Mutex_8h.html">Mutex.h</a></div></div>
<div class="ttc" id="agroup__threads_html_classRingBuffer"><div class="ttname"><a href="group__threads.html#classRingBuffer">RingBuffer</a></div><div class="ttdoc">Thread-safe circular ring buffer queue.</div><div class="ttdef"><b>Definition:</b> RingBuffer.h:33</div></div>
<div class="ttc" id="agroup__threads_html_add028ff4436a9c7467ea5df2d81623a4a5a1ff357668813e74eb7656cc035f91e"><div class="ttname"><a href="group__threads.html#add028ff4436a9c7467ea5df2d81623a4a5a1ff357668813e74eb7656cc035f91e">RingBuffer::ZeroCopy</a></div><div class="ttdeci">@ ZeroCopy</div><div class="ttdoc">Buffers should be allocated in mapped CPU/GPU zeroCopy memory (otherwise GPU only)</div><div class="ttdef"><b>Definition:</b> RingBuffer.h:47</div></div>
<div class="ttc" id="agroup__threads_html_a767436a25c53cfb845f731e0ff633120"><div class="ttname"><a href="group__threads.html#a767436a25c53cfb845f731e0ff633120">RingBuffer::mLatestWrite</a></div><div class="ttdeci">uint32_t mLatestWrite</div><div class="ttdef"><b>Definition:</b> RingBuffer.h:106</div></div>
<div class="ttc" id="agroup__threads_html_add028ff4436a9c7467ea5df2d81623a4a016f5aaf642491df7dd14d2728b38973"><div class="ttname"><a href="group__threads.html#add028ff4436a9c7467ea5df2d81623a4a016f5aaf642491df7dd14d2728b38973">RingBuffer::ReadLatestOnce</a></div><div class="ttdeci">@ ReadLatestOnce</div><div class="ttdoc">Combination of ReadOnce and ReadLatest flags.</div><div class="ttdef"><b>Definition:</b> RingBuffer.h:44</div></div>
<div class="ttc" id="agroup__threads_html_ab2322c263d4e1e928848ff4c33893713"><div class="ttname"><a href="group__threads.html#ab2322c263d4e1e928848ff4c33893713">RingBuffer::mLatestRead</a></div><div class="ttdeci">uint32_t mLatestRead</div><div class="ttdef"><b>Definition:</b> RingBuffer.h:105</div></div>
<div class="ttc" id="agroup__threads_html_aa3177dcbe1bf1a936e810a709361df94"><div class="ttname"><a href="group__threads.html#aa3177dcbe1bf1a936e810a709361df94">RingBuffer::mFlags</a></div><div class="ttdeci">uint32_t mFlags</div><div class="ttdef"><b>Definition:</b> RingBuffer.h:107</div></div>
<div class="ttc" id="agroup__threads_html_a65cd66112df93d973d7425295c382055"><div class="ttname"><a href="group__threads.html#a65cd66112df93d973d7425295c382055">RingBuffer::Peek</a></div><div class="ttdeci">void * Peek(uint32_t flags)</div><div class="ttdoc">Get the next read/write buffer without advancing the position in the queue.</div></div>
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_54a0acf6da04fe2ed9410b4c6369bc5d.html">jetson-utils</a></li><li class="navelem"><a class="el" href="RingBuffer_8h.html">RingBuffer.h</a></li>
    <li class="footer">Generated on Tue Mar 28 2023 14:27:58 for Jetson Inference by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.17 </li>
  </ul>
</div>
</body>
</html>
